﻿<Window x:Class="ColorControl.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
		xmlns:local="clr-namespace:ColorControl.Models"
		mc:Ignorable="d"
		Title="RBG LED control"
		Height="150"
		Width="300"
		WindowStartupLocation="CenterScreen"
		ResizeMode="CanMinimize"
		WindowStyle="SingleBorderWindow"
		Closing="Window_Closing">

	<Window.Resources>
		<ResourceDictionary>
			<local:PropertiesModel x:Key="context"/>
		</ResourceDictionary>
	</Window.Resources>
	<Grid DataContext="{StaticResource context}" Margin="10">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="1*"/>
			<ColumnDefinition Width="2*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<TextBlock Text="IP-address:" VerticalAlignment="Center"/>
		<TextBox Grid.Column="1" Text="{Binding Address}" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
		<TextBlock Grid.Row="1" Text="Mode:" VerticalAlignment="Center"/>
		<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Modes}" SelectedItem="{Binding Mode}" DisplayMemberPath="Name" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
		<TextBlock Grid.Row="2" Text="Color:" VerticalAlignment="Center"/>
		<xctk:ColorPicker Grid.Row="2" Grid.Column="1" SelectedColor="{Binding Mode.CurrentColor}" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
	</Grid>
</Window>
